<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>0411-04 3D立方体</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            /*border:1px solid #000;*/
            margin: 100px auto;
            transform-style:preserve-3d;
            position: relative;
            animation:gun 8s linear infinite
        }
        @keyframes gun {
            0%{
                transform: rotateY(360deg) rotateZ(0deg) rotateX(0deg);
            }
            100%{
                transform: rotateY(0deg) rotateZ(360deg) rotateX(360deg);
            }
        }
        .box div{
            position: absolute;
            width:100%;
            height: 100%;
            text-align: center;
            line-height:200px;
            font-size:50px;
            left:0;
            top:0;
            background-image: linear-gradient(to right,rgba(255,255,255,.8),rgba(255,0,0,.9))
        }
        .box1{
            transform: translateZ(100px);
        }
        .box2{
            transform: translateZ(-100px) rotateY(180deg);
        }
        .box3{
            transform: translateX(-100px) rotateY(-90deg);
        }
        .box4{
            transform: translateX(100px) rotateY(90deg);
        }
        .box5{
            transform: translateY(-100px) rotateX(90deg);
        }
        .box6{
            transform: translateY(100px) rotateX(-90deg);
        }
    </style>
</head>
<body>
<div class="box">
    <div class="box1">前</div>
    <div class="box2">后</div>
    <div class="box3">左</div>
    <div class="box4">右</div>
    <div class="box5">上</div>
    <div class="box6">下</div>
</div>
</body>
</html>